package com.powernode.service.impl;

import com.powernode.domain.Users;
import com.powernode.mapper.UsersMapper;
import com.powernode.service.UsersService;
import com.powernode.utils.MD5Utils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
@Service
public class UsersServiceImpl implements UsersService{

    @Autowired
    private UsersMapper usersMapper;

    @Override
    public Users loginUser(Users users) {
      //将传递过来的密码进行MD5加密,并设置回去
        users.setPassword(MD5Utils.md5(users.getPassword()));
        //去查询用户是否存在
        Users user = usersMapper.selectUser(users);
      return user;
    }
}
